SpringBoot 统一给URL添加/api前缀
在
src\main\resources
目录的配置文件 application.properties
中添加如下配置:server.servlet.contextPath=/api # SpringBoot 2.x
server.contextPath=/api # SpringBoot 1.x